import React, { useState } from 'react'

const LinkButton = () => {
  const [link, setLink] = useState(0)
  const hanleClik = () => {
    setTimeout(() => {
      alert(`you clicked ${link} times`)
    }, 2000)
  }
  return (
    <div>
      <h1>Ref的测试</h1>
      <button onClick={() => setLink(link + 1)}>{link}点击</button>
      <br />
      <button onClick={hanleClik}>alert</button>
    </div>
  )
}

export default LinkButton
